/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import org.jasypt.util.password.BasicPasswordEncryptor;

/**
 *
 * @author wei
 */
public class PasswordEncryptor {
    
    public static String encryptPassword(String password) {
        BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
        String encryptedPassword = passwordEncryptor.encryptPassword(password);

        return encryptedPassword;
    }
    
    public static boolean checkPassword(String plainPassword, String encryptedPassword) {
        BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
            return passwordEncryptor.checkPassword(plainPassword, encryptedPassword);
    }
    
}
